package com.wll.ec.core.app;

import com.wll.ec.core.util.storage.EcPreference;

/**
 * Created by detachment on 2020/3/17
 */
public class AccountManager {

    private enum SignTag{
        SIGN_TAG
    }

    // 保存用户登录状态，登录后调用
    public static void setSignState(boolean state){
        EcPreference.setAppFlag(SignTag.SIGN_TAG.name(), state);
    }

    private static boolean isSignIn(){
        return EcPreference.getAppFlag(SignTag.SIGN_TAG.name());
    }

    public static void checkAccount(IUserChecker checker){
        if (isSignIn()){
            checker.onSignIn();
        } else {
            checker.onNoSignIn();
        }
    }

}
